import React, { useEffect, useState } from "react";
import './privacypolicy.css';
import { saveEvent } from "@/store/actions/saveEvent";
import { useDispatch } from "react-redux";
import { useHistory } from "react-router-dom/cjs/react-router-dom.min";
import ProofNavigateBar from "@/components/ProofNavigateBar";

/**
 * 安装页
 */
export default function PrivacyPolicy() {

    // 获取路由历史 history 对象
    const history = useHistory()

    //获取 Redux 分发器
    const dispatch = useDispatch()

    //显示add home弹框
    const [addHomeMaskVisible, setAddHomeMaskVisible] = useState(false);
    const [addHomeMaskIsHomeMode, setAddHomeMaskIsHomeMode] = useState(true);


    //启动时监听
    useEffect(() => {
        //获取贷款详情
        try {
            //打点
            doHitEvent("PRIVACY_POLICY_START")

            return () => {
                //打点
                doHitEvent("PRIVACY_POLICY_END")
            }

        } catch (e) {
            console.log(e)
        }
    }, [])


    //打点接口
    const doHitEvent = async (type, remark = "") => {
        console.log("doHitEvent: " + type + " , " + remark);

        try {
            //获取Action
            const action = saveEvent(type, remark)

            //触发接口
            await dispatch(action)

        } catch (e) {
            console.log(e)
        }
    }

    //点击返回
    const onHandleNavGoBack = () => {
        console.log("go back")
        history.goBack()
    }

    return (
        <div className="termsofuseRoot">

            {/* 顶部背景 */}
            {/* <div className="applyTopBackground"></div> */}
            <ProofNavigateBar theme="white" onBackClick={onHandleNavGoBack} onAddFavorite={() => { setAddHomeMaskIsHomeMode(false); setAddHomeMaskVisible(true) }} onAddHome={() => { setAddHomeMaskIsHomeMode(true); setAddHomeMaskVisible(true) }}>Privacy Policy</ProofNavigateBar>

            <span>Please read our privacy policy carefully to get a clear understanding of how we collect, use, disclose, store, protect or otherwise handle your Personally Identifiable Information in accordance with our website.</span>
            <span className="termsofuseMarginTop16Px">SunnyCash ("Company," "We," "Us," or "Our"), is committed to protect the privacy and security of all personal and/or sensitive information (the "Personal Data") related to its employees, customers, business partners, suppliers, contractors, and other parties that the Company will and is engaged into. For this reason, uniform practice and procedure for collecting, recording, consolidating, updating, disclosing, storing, accessing, transferring, retaining, destructing and disposing of Personal Data by the Company are hereby adopted order to process Personal Data fairly, appropriately, and lawfully.</span>
            <span className="termsofuseMarginTop16Px">This Privacy Policy sets out the use, protection, and control of the company over the personal data it proces. The Company may change this policy from time to time by updating it in accordance with the Data Privacy Act of 2012, its Implementing Rules and Regulations,  Advisories and issuances and other relevant laws. The terms of this Privacy Policy apply to all person whose personal data is processed by SunnyCash.</span>

            <div className="termsofuseMarginTop16Px">INTRODUCTION</div>
            <span>We have created a mobile application called "SunnyCash" (Application/ App / Platform) through which you can apply for a short-term loan, or "Loan," which will be granted by us, or by different non-banking financial companies, or banks (collectively, "Lender," or "Lenders"), based on the loan agreement signed by you and LENDER. As may be necessary for sanctioning the Loan, we have been appointed and given authority to collect, store, authenticate, verify, and distribute Personal Information (defined below). </span>
            <span className="termsofuseMarginTop16Px">The mobile application form found on the Application is how the Personal Information will be gathered. Since we value your privacy, we have created this Privacy Policy to outline the practices we follow when gathering, using, and disclosing Personal Information. We advise you to carefully read this privacy statement so that you understand our approach towards the use of your Personal Information.</span>

            <div className="termsofuseMarginTop16Px">COLLECTION OF INFORMATION</div>
            <span>You may scroll through our Website and generally view the contents of the Website without providing us any personal information. In such a case, We will place a Cookie on Your computer that will help us identity You should You decide to visit us again.</span>
            <span className="termsofuseMarginTop16Px">During Your use of the Platform, whether the App or the Website, We will collect certain NON-PERSONAL AND PERSONAL information from You.</span>
            <span className="termsofuseMarginTop16Px">a.The Non-Personal Information:When You visit our Website, we typically collect the IP address of the device you use to connect to the internet, information such as what browser, browser version, operating system you have, the website you came from or the advertisement you viewed or clicked on. We also collect non-personal information on our Website and from third parties to provide an online experience that matches Your requirements.</span>
            <span className="termsofuseMarginTop16Px">b.The Personal Information: Is collected by Us after You explicitly provide us consent or is shared by You with Us pursuant to a clear disclosure - such as</span>

            <div className="termsofuseMarginTop16Px">PRIMARY ACCOUNT</div>
            <span>Allow SunnyCash to upload the user's primary account information permission, so as to conduct risk control assessment and give you pre-approved loan preferences. Encrypt and upload to the outside To identify and analyze their behaviors and risks, which will help prevent fraud.</span>

            <div className="termsofuseMarginTop16Px">CALLLOG</div>
            <span>If you authorize us to view call logs, we will provide you with a voice call for credit risk assessment, in order to confirm that our app is installed on your own phone and we will only download and transfer the content of the call logs to a secure network environment with your explicit consent. Under no condition will we never share this data with third parties.</span>

            <div className="termsofuseMarginTop16Px">STORAGE</div>
            <span>Access to your device's storage space requires your authorization, which will allow you to upload photos and/or documents to fill out the application form during the loan application process. Data will be encrypted and uploaded to our membership server , via HTTPS protocol. Your data will be protected and kept confidential. We will never share this data with third parties.</span>
       
            <div className="termsofuseMarginTop16Px">APPLICATION INSTALLED</div>
            <span>Monitor and collect the content of installed applications: application name, application package name, application installation time, application installation time, the data of installed applications will be encrypted and uploaded to our server through HTTPS protocol We will never share this data with third parties.</span>

            <div className="termsofuseMarginTop16Px">PLACE</div>
            <span>Collect and monitor information about device locations for risk assessment and scoring. We will upload location data to our servers SunnyCash , and your data will be protected and kept confidential.</span>

            <div className="termsofuseMarginTop16Px">CALENDAR</div>
            <span>It is used to remind you of the repayment date and avoid the impact of overdue repayment on your credit. We will upload the location data to the server to compare loans , and your data will be subject to Protect and keep confidential.</span>

            <div className="termsofuseMarginTop16Px">DATA STORAGE</div>
            <span>For all information collected, we will store it on SunnyCash servers , with a high degree of protection and will not be shared with any third party.</span>

            <div className="termsofuseMarginTop16Px">How do we use this information?</div>
            <span>Is passionate about helping its customers to access affordable financing to grow their business and a simple financial record-keeping tool to help them to better manage their business. We use all of the information we have to help us to:</span>
            <span className="termsofuseMarginTop16Px">Provide and improve our services. We will use all of the information that we have to ensure that and our services are meeting the needs of our users. We use this information to determine whether or not to provide a loan to a user, the amount of the loan, and the terms applicable to the loan. We also use the information to improve the features and usability of the App. </span>
            <span className="termsofuseMarginTop16Px">Improve the technology supporting the App to improve its convenience, efficiency, and security.</span>
            <span className="termsofuseMarginTop16Px">Communicate with you. We use this information to respond when you contact us, and when we communicate with you about our service. </span>
            <span className="termsofuseMarginTop16Px">Show targeted advertisements and measure their effectiveness. We use this information to improve our advertising and measure the level of interest that they generate in order to ensure that they are relevant to you. </span>
            <span className="termsofuseMarginTop16Px">We use your data for the necessary performance of a contract with you and because you have consented to the use of your personal data, or because it is in our legitimate business interests to use it.</span>

            <div className="termsofuseMarginTop16Px">Disclosure of Information</div>
            <span>We may share Your information with third parties including our regulated financial partners for provision of services on the Platform and/or for facilitation of a loan / facility to a User. We may also share Your information with third parties under a confidentiality agreement for provision of services which inter alia restricts such third parties from further disclosing the information unless such disclosure is for the purpose as detailed under that confidentiality agreement.</span>
            <span className="termsofuseMarginTop16Px">We will share Your information with third parties only in such manner as described below:</span>
            <span className="termsofuseMarginTop16Px">a.We may share Your information with our third-party partners in order to conduct data analysis in order to serve You better and provide Services on our Platform;</span>
            <span className="termsofuseMarginTop16Px">b.We may disclose Your information to the financial service providers, banks and Our third-party partners for providing the Services as detailed under the Terms & Conditions;</span>
            <span className="termsofuseMarginTop16Px">c.We may also share the data / information with our technology service providers to perform credit and know your customer checks to facilitate a loan for the User through regulated financial partner;</span>
            <span className="termsofuseMarginTop16Px">d.We may disclose Your information, without prior notice, if We are under a duty to do so in order to comply with any legal obligation or an order from the government and/or a statutory authority, or in order to enforce or apply Our terms of use or assign such information in the course of corporate divestitures, mergers, or to protect the rights, property, or safety of Us, Our users, or others. This includes exchanging information with other companies and organizations for the purposes of fraud protection and credit risk reduction.</span>
            <span className="termsofuseMarginTop16Px">e.We and our affiliates may share Your information with another business entity should we (or our assets) merge with, or be acquired by that business entity, or reorganization, amalgamation, restructuring of business for continuity of business.</span>

            <div className="termsofuseMarginTop16Px">Cookies</div>
            <span>Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.</span>
            <span className="termsofuseMarginTop16Px">This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.</span>

            <div className="termsofuseMarginTop16Px">Security</div>
            <span>I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security</span>

            <div className="termsofuseMarginTop16Px">Children's Privacy</div>
            <span>These Services do not address anyone under the age of 18. I do not knowingly collect personally identifiable information from children under 18 years of age. In the case I discover that a child under 18 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.</span>

            <div className="termsofuseMarginTop16Px">CHANGES TO THIS POLICY</div>
            <span>We may update this Privacy Policy without notice to you. This Privacy Policy is effective upon publication and apply to all users. You are encouraged to check this Privacy Policy on a regular basis to be aware of the changes made to it. Continued use of the Services and access to the Platform shall be deemed to be your acceptance of this Privacy Policy.</span>

            <div className="termsofuseMarginTop16Px">Contact us</div>
            <span>If you have any questions about our privacy policy or products while browsing the Privacy Policy, please contact us directly.</span>
            <span className="termsofuseMarginTop16Px">Email:SunnyCashkenyaservice@outlook.com</span>
            <span className="termsofuseMarginTop16Px">Phone number:+254  0743929674</span>
            <span className="termsofuseMarginTop16Px">Address: PGD22+CM, +225 Nairobi, Kenya</span>

        </div >
    )
}